import service from '@/core/net/request'
import { queryParams } from '@/core/utils/tools'

export function getAgentList(page, query = {}) {
  let r = queryParams(query)
  return service.get(`/api/admin/agent/${page}${r}`)
}

export function getAgentOrderList(page, query = {}) {
  let r = queryParams(query)
  return service.get(`/api/admin/user_bill/${page}${r}`)
}

export function getAgentStatistics() {
  return service.get('/api/admin/agent/statistics')
}

export function getConfig() {
  return service.get(`/api/admin/distribution_setting/get`)
}

export function setConfig(data) {
  return service.post(`/api/admin/distribution_setting/set`, data)
}
